package com.read.operationsapi.controller;

import com.mc.read.vo.request.BaseRequest;
import com.mc.read.vo.respose.BaseRespose;
import com.read.operationsapi.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liuhao
 * @date 2019/6/17 18:38
 */
@Controller
@RequestMapping(value = "/statistics/")
public class StatisticsController {
    @Autowired
    StatisticsService statisticsService;

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 下载量统计 statisticsForDownload
     **/
    @ResponseBody
    @RequestMapping(value = "statisticsForDownload", method = RequestMethod.POST)
    public BaseRespose statisticsForDownload(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.statisticsForDownload(baseRequest);
        return baseRespose;
    }


    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户注册统计 staUserReg
     **/
    @ResponseBody
    @RequestMapping(value = "staUserReg", method = RequestMethod.POST)
    public BaseRespose staUserReg(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserReg(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 活跃用户统计 staActiveUser
     **/
    @ResponseBody
    @RequestMapping(value = "staActiveUser", method = RequestMethod.POST)
    public BaseRespose staActiveUser(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staActiveUser(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 阅读时间段统计 staReadTime
     **/
    @ResponseBody
    @RequestMapping(value = "staReadTime", method = RequestMethod.POST)
    public BaseRespose staReadTime(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staReadTime(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 功能点击次数统计 staFunctionClick
     **/
    @ResponseBody
    @RequestMapping(value = "staFunctionClick", method = RequestMethod.POST)
    public BaseRespose staFunctionClick(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staFunctionClick(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 小说类型累计阅读人数 staBookTypeReadSum
     **/
    @ResponseBody
    @RequestMapping(value = "staBookTypeReadSum", method = RequestMethod.POST)
    public BaseRespose staBookTypeReadSum(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staBookTypeReadSum(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 不活跃用户统计 staNotActiveUser
     **/
    @ResponseBody
    @RequestMapping(value = "staNotActiveUser", method = RequestMethod.POST)
    public BaseRespose staNotActiveUser(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staNotActiveUser(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 热门小说统计 selectHotBook
     **/
    @ResponseBody
    @RequestMapping(value = "selectHotBook", method = RequestMethod.POST)
    public BaseRespose selectHotBook(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.selectHotBook(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 根据收入查询喜欢类型 staBookTypeByIncome
     **/
    @ResponseBody
    @RequestMapping(value = "staBookTypeByIncome", method = RequestMethod.POST)
    public BaseRespose staBookTypeByIncome(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staBookTypeByIncome(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户男女比例统计 staUserSex
     **/
    @ResponseBody
    @RequestMapping(value = "staUserSex", method = RequestMethod.POST)
    public BaseRespose staUserSex(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserSex(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户地区分布 staUserRegion
     **/
    @ResponseBody
    @RequestMapping(value = "staUserRegion", method = RequestMethod.POST)
    public BaseRespose staUserRegion(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserRegion(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户年龄分布 staUserAge
     **/
    @ResponseBody
    @RequestMapping(value = "staUserAge", method = RequestMethod.POST)
    public BaseRespose staUserAge(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserAge(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户书籍类型分布 staUserBookBype
     **/
    @ResponseBody
    @RequestMapping(value = "staUserBookBype", method = RequestMethod.POST)
    public BaseRespose staUserBookBype(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserBookBype(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户阅读时长统计 staUserReadTime
     **/
    @ResponseBody
    @RequestMapping(value = "staUserReadTime", method = RequestMethod.POST)
    public BaseRespose staUserReadTime(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserReadTime(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 用户收藏排行 staUserCollection
     **/
    @ResponseBody
    @RequestMapping(value = "staUserCollection", method = RequestMethod.POST)
    public BaseRespose staUserCollection(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserCollection(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 某本小说的男女比例 staUserSexByBook
     **/
    @ResponseBody
    @RequestMapping(value = "staUserSexByBook", method = RequestMethod.POST)
    public BaseRespose staUserSexByBook(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserSexByBook(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 某本小说的地区分布 staUserRegionByBook
     **/
    @ResponseBody
    @RequestMapping(value = "staUserRegionByBook", method = RequestMethod.POST)
    public BaseRespose staUserRegionByBook(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserRegionByBook(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 某本小说的收入分布 staUserIncomeByBook
     **/
    @ResponseBody
    @RequestMapping(value = "staUserIncomeByBook", method = RequestMethod.POST)
    public BaseRespose staUserIncomeByBook(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.staUserIncomeByBook(baseRequest);
        return baseRespose;
    }

    /**
     * @Author:LiuHao
     * @Date:15:24 2019/5/31
     * 弹幕列表查询 selectChatrecord
     **/
    @ResponseBody
    @RequestMapping(value = "selectChatrecord", method = RequestMethod.POST)
    public BaseRespose selectChatrecord(@RequestBody BaseRequest baseRequest) {
        BaseRespose baseRespose = statisticsService.selectChatrecord(baseRequest);
        return baseRespose;
    }
}
